-- click su open on mouseEnter if the visible of window "Help" then tell window "help" to go to frame "synth12" end on mouseLeave if the visible of window "Help" then tell window "help" to go to frame "start" end on mouseDown global gOn if gOn and not(the visible of sprite 76) and not(the visible of window "help") then repeat while the mouseDown set the memberNum of sprite 67 to the number of member "Hopen" updateStage end repeat end if end on mouseUp global gOn if gOn and not(the visible of window "help") then -- se c'è il fieldElencoSynthSalvati aperto si chiude e non prende il click if the visible of sprite 76 then pass else set the memberNum of sprite 67 to the number of member "open" updateStage openWin "openS" -- compilo il fieldElencoSynth put "" into field "fieldElencoSynth" repeat with i = 1 to count(folderSynthList) put getAt(folderSynthList,i) & return after field "fieldElencoSynth" end repeat set the scrollTop of member "fieldElencoSynth" to 0 set the font of member "fieldElencoSynth" to "GMFont" set the forecolor of member "fieldElencoSynth" to 0 end if end if end ******************************************************* -- mouse su fieldProg on mouseEnter if the visible of window "Help" then tell window "help" to go to frame "synth8" end on mouseLeave if the visible of window "Help" then tell window "help" to go to frame "start" end on mouseDown global gOn global progList,folderSynthList -- se c'è il fieldElencoSynthSalvati aperto non prende il mouseDown -- funziona se il programma non è bloccato dal pulsante rosso if gOn and not(the visible of sprite 76)and (folderSynthList <> []) and not(the visible of window "help") then put getPos(progList,field "fieldProg") into valore set start = the mouseV repeat while the mouseDown set temp = (the mouseV - start) set temp = abs((valore + temp) mod 4 + 1) if temp = 0 then set temp = 1 put getAt(progList,temp) into field "fieldProg" end repeat set the font of member "fieldProg" to "GMFont" set the foreColor of member "fieldProg" to 14 end if end on mouseUp global gProg,gArp,gOn,gOnSynth,gPosVolSynth,gPosPanSynth,gSynthSel global progList,synthList,folderSynthList if gOn and (folderSynthList <> []) and not(the visible of window "help") then -- se c'è il fieldElencoSynthSalvati aperto si chiude e non prende il click if the visible of sprite 76 then pass else set gProg = field "fieldProg" -- se la sequenza sta suonando si aggiorna -- calcolo arp case(getPos(arpList,gArp)) of 1,2,3,4:set arp = integer(chars(gArp,3,length(gArp)))/4 otherwise set arp = 4 end case if gOnSynth then -- vol e pan IKSynthVolume integer(128*(-gPosVolSynth+54)/45) IKSynthPan integer(128*(-gPosPanSynth+54)/45) IKSynthArp getPos(progList,gProg)-1,arp,createSeq() end if -- se c'è l'hilite intorno ai marker sparisce if gSynthSel then set the locH of sprite 74 to -20 set gSynthSel = 0 end if end if end if end ******************************************************* -- mouse su fieldArp on mouseEnter if the visible of window "Help" then tell window "help" to go to frame "synth15" end on mouseLeave if the visible of window "Help" then tell window "help" to go to frame "start" end on mouseDown global gOn,valore global arpList,folderSynthList -- se c'è il fieldElencoSynthSalvati aperto non prende il mouseDown -- funziona se il programma non è bloccato dal pulsante rosso if gOn and not(the visible of sprite 76) and (folderSynthList <> []) and not(the visible of window "help") then put getPos(arpList,field "fieldArp") into valore set start = the mouseV repeat while the mouseDown set temp = (the mouseV - start) set temp = abs((valore + temp) mod 36 + 1) if temp = 0 then set temp = 1 put getAt(arpList,temp) into field "fieldArp" end repeat set the font of member "fieldArp" to "GMFont" set the foreColor of member "fieldArp" to 14 end if end on mouseUp global gProg,gArp,gOn,gOnSynth,gPosVolSynth,gPosPanSynth,gSynthSel global progList,synthList,folderSynthList if gOn and (folderSynthList <> []) and not(the visible of window "help") then -- se c'è il fieldElencoSynthSalvati aperto si chiude e non prende il click if the visible of sprite 76 then pass else set gArp = field "fieldArp" case(getPos(arpList,gArp)) of 1,2,3,4:set arp = integer(chars(gArp,3,length(gArp)))/4 otherwise set arp = 4 end case -- se la sequenza sta suonando si aggiorna if gOnSynth then -- vol e pan IKSynthVolume integer(128*(-gPosVolSynth+54)/45) IKSynthPan integer(128*(-gPosPanSynth+54)/45) IKSynthArp getPos(progList,gProg)-1,arp,createSeq() end if -- se c'è l'hilite intorno ai marker sparisce if gSynthSel then set the locH of sprite 74 to -20 set gSynthSel = 0 end if end if end if end ******************************************************* -- mouse su fieldSynth on mouseEnter if the visible of window "Help" then tell window "help" to go to frame "synth7" end on mouseLeave if the visible of window "Help" then tell window "help" to go to frame "start" end on mouseDown global gOn global folderSynthList global valore,synth -- valore è riferito al synth visualizzato nel field nel momento in cui inizia il mouseDown, synth fa riferimento al valore che c'è quando finisce il mouseDown, queste variabili mi servono per capire se devo fare il mouseUp, se quando tento di fare il mouseUp questi due valori sono uguali allora significa che non ho fatto il mouseDown e quindi faccio il mouseUp, altrimenti facevo il mouseDown e rilasciando il mouse scattava ancora di un valore -- se c'è il fieldElencoSynthSalvati aperto non prende il mouseDown -- funziona se il programma non è bloccato dal pulsante rosso if gOn and not(the visible of sprite 76) and (folderSynthList <> []) and not(the visible of window "help") then put getPos(folderSynthList,field "fieldSynth") into valore set start = the mouseV set the font of member "fieldSynth" to "GMFont" set the foreColor of member "fieldSynth" to 14 repeat while the mouseDown set synth = (the mouseV - start) set synth = abs((valore + synth) mod count(folderSynthList) + 1) if synth = 0 then set synth = 1 set the font of member "fieldSynth" to "GMFont" set the foreColor of member "fieldSynth" to 14 put getAt(folderSynthList,synth) into field "fieldSynth" end repeat set the font of member "fieldSynth" to "GMFont" set the foreColor of member "fieldSynth" to 14 end if end on mouseUp global gPath,gWav,gProg,gArp,gOnSynth,gOn,gPosVolSynth,gPosPanSynth,gSynthSel global progList,arpList,folderSynthList,synthList global valore,synth if gOn and (folderSynthList <> []) then -- se c'è il fieldElencoSynthSalvati aperto si chiude e non prende il click if the visible of sprite 76 then pass else if valore = synth then set pos = getPos(folderSynthList,field "fieldSynth") + 1 if pos <> (count(folderSynthList) + 1) then put getAt(folderSynthList,pos) into field "fieldSynth" else put getAt(folderSynthList,1) into field "fieldSynth" end if end if if gOnSynth then IKSynthStop IKSetSynth gPath & "synth:synth" & gWav & ":" & field "fieldSynth" & ":" -- calcolo arp case(getPos(arpList,gArp)) of 1,2,3,4:set arp = integer(chars(gArp,3,length(gArp)))/4 otherwise set arp = 4 end case -- vol e pan IKSynthVolume integer(128*(-gPosVolSynth+54)/45) IKSynthPan integer(128*(-gPosPanSynth+54)/45) if synthList <> [] then IKSynthArp getPos(progList,gProg)-1,arp,createSeq() -- se c'è l'hilite intorno ai marker sparisce if gSynthSel then set the locH of sprite 74 to -20 set gSynthSel = 0 end if set the font of member "fieldSynth" to "GMFont" set the foreColor of member "fieldSynth" to 14 end if end if end ******************************************************* -- click su fieldElelncoSynthSalvati on mouseDown if line(the mouseline) of field "fieldElencoSynthSalvati" <> "" and not(the visible of window "help") then set the foreColor of line(the mouseline) of field "fieldElencoSynthSalvati" to 14 end if end on mouseUp global gPath,gArp,gProg,gWav,gOnSynth,gPosVolSynth,gPosPanSynth,gSynthSel global synthList,progList,arpList,synthSaveList if the visible of sprite 77 and not(the visible of window "help") then -- se clicco fuori dalle linee si chiude la finestra if line(the mouseline) of field "fieldElencoSynthSalvati" <> "" then -- se clicco tenendo premuto il tatso SHIFT si cancella il synth salvato if the shiftDown then set nome = line(the mouseLine) of field "fieldElencoSynthSalvati" & ".txt" deleteOne synthSaveList,nome IKChangeAttrib gPath & "synthM:" & gWav & ":" & nome deleteFile(gPath & "synthM:" & gWav & ":" & nome) else set the foreColor of line(the mouseline) of field "fieldElencoSynthSalvati" to 0 set nomeFile = gPath & "synthM:" & gWav & ":" & line(the mouseline) of field "fieldElencoSynthSalvati" & ".txt" -- leggo il file di testo set myFile = new(xtra "fileio") openFile(myFile,nomeFile,1) set theFile = readFile(myFile) closeFile(myFile) set myFile = 0 -- compilo la synthList set synthList = [] repeat with i = 1 to the number of words in line 1 of theFile setAt synthList,i,word i of line 1 of theFile end repeat -- compilo i field e aggiorno le variabili set gArp = word 2 of line 2 of theFile set gProg = word 3 of line 2 of theFile set gPosVolSynth = integer(word 4 of line 2 of theFile) set gPosPanSynth = integer(word 5 of line 2 of theFile) put gProg into field "fieldProg" put gArp into field "fieldArp" put word 1 of line 2 of theFile into field "fieldSynth" -- hilite delle note -- se la nota compare sia nella synthList precedente che nella synthList attuale non succede niente -- se la nota non compare nella synthList precedente e compare nella synthList attuale si accende l'hilite -- se la nota compare nella synthList precedente e non compare nella synthList attuale si spegne l'hilite repeat with i = 1 to 3 set start = 12*(i-1) + 3 repeat with j = 1 to 12 set nota = the name of member the memberNum of sprite (start + j) if char 1 of nota = "y" then set nota = chars(nota,2,length(nota)) & i if not getPos(synthList,nota) then set nota = chars(nota,1,length(nota)-1) set the memberNum of sprite (start + j) to the number of member nota updatestage end if else set nota = nota & i if getPos(synthList,nota) then set nota = "y" & chars(nota,1,length(nota)-1) set the memberNum of sprite (start+j) to the number of member nota updateStage end if end if end repeat end repeat -- play if gOnSynth then IKSynthStop else set gOnSynth = 1 end if IKSetSynth gPath & "synth:synth" & gWav & ":" & field "fieldSynth" & ":" -- riposiziono il vol e il pan set the locV of sprite 45 to gPosVolSynth set the locV of sprite 46 to gPosPanSynth updateStage -- calcolo arp case(getPos(arpList,gArp)) of 1,2,3,4:set arp = integer(chars(gArp,3,length(gArp)))/4 otherwise set arp = 4 end case -- vol e pan IKSynthVolume integer(128*(-gPosVolSynth+54)/45) IKSynthPan integer(128*(-gPosPanSynth+54)/45) IKSynthArp getPos(progList,gProg)-1,arp,createSeq() end if -- si chiude la finestra repeat with i = 76 to 79 set the visible of sprite i to false end repeat -- se c'è l'hilite intorno ai marker sparisce if gSynthSel then set the locH of sprite 74 to -20 set gSynthSel = 0 end if end if end if end ******************************************************* -- ************************************************************************************ -- * * -- * NOTE * -- * * -- * i canali dal 4 al 15 contengono i tasti della prima ottava * -- * i canali dal 16 al 27 contengono i tasti della seconda ottava * -- * i canali dal 28 al 39 contengono i tasti della terza ottava * -- * i canali dal 14 al 21 contengono le barre dei volumi * -- * * -- * i canali dal 47 al 58 contengono i marker con le note consigliate * -- * * -- * i canali dal 68 al 73 contengono i numeri dei synth marcati * -- * i canale 76 e 79 contengono il field con l'elenco dei synth salvati, all'apertura* -- * del file sono invisibili, compaiono quando clicco su load * -- * nel canale 88 metto temporaneamente i synth marcati mentre vengono spostati * -- * per far si che passino sopra a tutti gli altri oggetti * -- ************************************************************************************ -- all'uscita dal primo frame compaiono i marker per le note consigliate -- i marker occupano i frame dal 47 al 58 (ogni frame per una nota da C a B) -- inoltre se la finestar era stata chiusa in play si accende l'hilite sui tasti che stavano suonando on exitFrame global scaleList,markerNoteList,synthList,markerSynthList set temp = ["C","Cd","D","Dd","E","F","Fd","G","Gd","A","Ad","B"] -- marker note consigliate repeat with i = 1 to 12 set nota = getAt(temp,i) -- se la nota è nella scaleList compaiono i marker relativi if getPos(scaleList,nota) then set the locH of sprite (46 + i) to getAt(markerNoteList,i) updateStage end if end repeat -- hilite note che stanno suonando if synthList <> [] then repeat with i = 1 to 3 set start = 12*(i-1) + 3 -- frame prima dell'inizio di ogni ottava repeat with j = 1 to 12 set nota = the name of member the memberNum of sprite (start+j) & i -- se la nota compare nella synthList si accende l'hilite if getPos(synthList,nota) then set Hnota = "y" & chars(nota,1,length(nota)-1) set the memberNum of sprite (start+j) to the number of member Hnota updateStage end if end repeat end repeat end if -- compaiono i marker dei synth (se ce ne sono) if markerSynthList <> [] then repeat with i = 1 to min(count(markerSynthList),6) set the memberNum of sprite (67+i) to the number of member string(i) updateStage end repeat end if createGlobalVariable handleSprite createList end ******************************************************* on exitFrame go to the frame end on enterFrame global gOn,gOnSynth,gPath,gWav,gArp,gProg,gPosVolSynth,gPosPanSynth global folderSynthList,arpList,progList,synthList -- controllo del led rosso if gOn and gOnSynth then if the visible of sprite 3 then set the visible of sprite 3 to false end if else if not(the visible of sprite 3) then set the visible of sprite 3 to true end if -- se è aperta openS if the visible of window "openS" then if field "fieldSynth" = "" and folderSynthList <> [] then put getAt(folderSynthList,1) into field "fieldSynth" IKSetSynth gPath & "synth:synth" & gWav & ":" & field "fieldSynth" & ":" set the font of field "fieldSynth" to "GMFont" set the foreColor of member "fieldSynth" to 14 updateStage end if if field "fieldSynth" <> "" and folderSynthList = [] then put "" into field "fieldSynth" set the font of field "fieldSynth" to "GMFont" set the foreColor of member "fieldSynth" to 14 updateStage IKSynthStop repeat with i = 1 to 3 set start = 12*(i-1) + 3 -- frame prima dell'inizio di ogni ottava repeat with j = 1 to 12 if char 1 of the name of member the memberNum of sprite (start+j) = "y" then set nota = chars(the name of member the memberNum of sprite (start+j),2,length(the name of member the memberNum of sprite (start+j))) & i if getPos(synthList,nota) then set nota = chars(nota,1,length(nota)-1) set the memberNum of sprite (start+j) to the number of member nota updateStage end if end if end repeat end repeat set synthList = [] set gOnSynth = 0 end if -- se tolgo il synth che sta suonando if (field "fieldSynth" <> "") and (folderSynthList <> []) then if not getPos(folderSynthList,field "fieldSynth") then put getAt(folderSynthList,1) into field "fieldSynth" set the font of field "fieldSynth" to "GMFont" set the foreColor of member "fieldSynth" to 14 updateStage IKSynthStop IKSetSynth gPath & "synth:synth" & gWav & ":" & field "fieldSynth" & ":" -- calcolo arp case(getPos(arpList,gArp)) of 1,2,3,4:set arp = integer(chars(gArp,3,length(gArp)))/4 otherwise set arp = 4 end case IKSynthVolume integer(128*(-gPosVolSynth+54)/45) IKSynthPan integer(128*(-gPosPanSynth+54)/45) IKSynthArp getPos(progList,gProg)-1,arp,createSeq() end if end if end if end *******************************************************